// written by Jonathan Odom and Aneesh Butani

#ifndef XMLPARSER_H_
#define XMLPARSER_H_
#include <fstream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include "appt.h"
#include "event.h"

using namespace std;

class XMLParser
{
public:
	XMLParser();
	~XMLParser();
	XMLParser(const string& fileName);
	XMLParser(const string& fileName, int whichEvent);
    void readAppt();
    void readAppt2();
    void readBirthday();
    vector<Event> getEvents();
    string getTag(ifstream&);
    void getNode(ifstream&, ofstream&, string, string, string);
    void getNode(ifstream&, ofstream&, string, string, string, string);


private:
	static string APPT;
	static string DAY;
	static string SUBJECT;
	static string TIME;
	static string start;
	static string end;
	static string description;
	static string event;
	
	void readNodeBirthday(const string& node);

    vector<Event> myEvents;
    void readNodeAppt(const string& node);
    ifstream input; 
    string myFileName;
    string getInfoAppt(const string& node, const string& info);
    void getTimeRangeAppt(const string& node, const string& infoType, int range[]);
    void seperateTime(int range[], const string& times);
 
	
};

#endif /*XMLPARSER_H_*/
